﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL;
using Model;

namespace BLL
{
    public class SalesRecordBO
    {
        public SalesRecordBO() { }

        SalesRecordDAO dao = new SalesRecordDAO();

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(SalesRecord model)
        {
            return dao.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(SalesRecord model)
        {
            return dao.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(int ID)
        {
            dao.Delete(ID);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SalesRecord GetModel(int ID)
        {
            return dao.GetModel(ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dao.GetList(strWhere);
        }

        /// <summary>
        /// 总榜
        /// </summary>
        /// <returns></returns>
        public DataTable GetZongBang()
        {
            return dao.GetZongBang();
        }

        /// <summary>
        /// 店铺榜
        /// </summary>
        /// <returns></returns>
        public DataTable GetStoreBang()
        {
            return dao.GetStoreBang();
        }

        /// <summary>
        /// 获取年月周
        /// </summary>
        /// <returns></returns>
        public string GetWeek()
        {
            return dao.GetWeek();
        }

        /// <summary>
        /// 月榜
        /// </summary>
        /// <returns></returns>
        public DataTable GetMonthBang()
        {
            return dao.GetMonthBang();
        }

        /// <summary>
        /// 周榜
        /// </summary>
        /// <returns></returns>
        public DataTable GetWeekBang()
        {
            return dao.GetWeekBang();
        }

        /// <summary>
        /// 获取月积分
        /// </summary>
        /// <param name="FromUserName"></param>
        /// <returns></returns>
        public Decimal GetDream(string FromUserName)
        {
            return dao.GetDream(FromUserName);
        }
    }
}
